/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-20 20:05:45
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-20 20:05:45
 */
public class StringComparison1 {
    public static void main(String[] args) {
        String s1 = "helloworld";
        String s2 = "hello";
        String s3 = "world";
        String s4 = "hello" + "world";
        String s5 = s2 + s3;
        String s6 = new String("helloworld");
        String s7 = "hello" + new String("world");

        System.out.println(s1 == s4);  // true
        System.out.println(s1 == s5);  // false
        System.out.println(s1 == s6);  // false
        System.out.println(s1 == s7);  // false
    }
}
